package com.ke.forum.mbg.entity.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ke.forum.mbg.entity.Section;
import com.ke.forum.mbg.entity.Sort;
import com.ke.forum.mbg.entity.User;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

@Data
public class ArticleDto {
    private Integer id;

    /**
     * 标题
     */
    @NotNull
    private String title;

    /**
     * 内容
     */
    @NotNull
    private String content;

    private String pictures;

    private String userUuid;

    private Integer sectionId;

    /**
     * 0为未审核  1为审核通过 2为审核未通过
     */
    private Integer isExamine;

    /**
     * 0为不是精品 1为是精品
     */
    private Integer isRare;

    /**
     * 0为不置顶，1为置顶
     */
    private Integer isTop;

    /**
     * 浏览次数
     */
    private Integer views;

    private Integer status;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    LocalDateTime createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    LocalDateTime updateTime;

    private User user;

    private String sortName;

    private String sectionName;

    private Integer commentNum;
}
